#include<bits/stdc++.h>
using namespace std;
typedef long long ll;

void solve(){
    ll n;
    cin>>n;
    vector<vector<ll>> nums(2,vector<ll>(n+1));
    ll sum=0,sumup=0;
    for(ll j=1;j<=n;j++){
        cin>>nums[0][j];
        sum+=nums[0][j];
        sumup+=nums[0][j];
    }
    for(ll j=1;j<=n;j++){
        cin>>nums[1][j];
        sum+=nums[1][j];
    }
    if(n==1){
        if(nums[0][1]>nums[1][1])   cout<<"Mandy"<<'\n';
        else if(nums[0][1]==nums[1][1]) cout<<"draw"<<'\n';
        else cout<<"brz"<<'\n';
        return;
    }
    if(n==2){
        ll maxn=nums[0][1]+max(nums[0][2],nums[1][1]);
        ll minn=nums[1][2]+min(nums[0][2],nums[1][1]);
            if(maxn>minn)   cout<<"Mandy"<<'\n';
            else if(maxn==minn) cout<<"draw"<<'\n';
            else cout<<"brz"<<'\n';
        return;
    }
    bool f=false;
    if(n%2==0){
        ll sum1=0,sumr=0;
        for(ll j=(n/2+2);j<=n;j++){
            sum1+=nums[0][j]+nums[1][j];
        }
        for(ll j=n/2+1;j<=n;j++){
            sumr+=nums[0][j]+nums[1][j];
        }
        ll sum2=sum-sum1;
        if(sum1>sum2){
            cout<<"brz"<<'\n';
            return;
        }else{
            if(sum1==sum2){
                f=true;
            }
            ll suml=0,sumu=0;
            for(int i=1;i<=n/2;i++){
                suml+=nums[1][i]+nums[0][i];
            }
            for(int i=1;i<=n;i++){
                sumu+=nums[0][i];
            }
            ll maxn=max(suml,sumu);
            ll minn=sum-maxn;
            if(maxn>minn&&!f)   cout<<"Mandy"<<'\n';
            else if(maxn<minn) cout<<"brz"<<'\n';
            else cout<<"draw"<<'\n';
            return;
        }
    }else{
        ll sum1=0,sumr=0;
        for(ll j=(n+1)/2+1;j<=n;j++){
            sum1+=nums[0][j]+nums[1][j];
        }
        if(sum1>sum-sum1)cout<<"brz"<<'\n';
        else{
            if(sum1==sum-sum1){
                f=true;
            }
            ll sumu=0,suml=0;
            for(int i=1;i<=n;i++){
                sumu+=nums[0][i];
            }
            for(int i=1;i<=n/2;i++){
                suml+=nums[0][i]+nums[1][i];
            }
            ll maxn=max(sumu,suml);
            ll minn=sum-maxn;
            if(maxn>minn&&!f)   cout<<"Mandy"<<'\n';
            else if(maxn<minn) cout<<"brz"<<'\n';
            else cout<<"draw"<<'\n';
        }
        return;
    }
}

int main(){
    ios::sync_with_stdio(0);
    cin.tie(0),cout.tie(0);
    ll _;
    cin>>_;
    while(_--){
        solve();
    }
    return 0;
}